Fix low-contrast selected item in dropdown menus#40
Conversation
The SimpleMenuPreference dropdown filled the selected row with an opaque colorMaterial100 (a very light per-theme tint, e.g. Dracula #E9DDFB). The item's CheckedTextView text stays light, so light-on-light made the selected option hard to read across themes (worst on dark themes). Highlight the selected row with a translucent colorPrimary (~20% alpha) instead, matching the existing nav_item_fill / ConfigurationFragment pattern. This reads on any background and keeps the text legible. Affects all themes.
|
Warning Review limit reached
More reviews will be available in 8 minutes and 23 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
Use alpha 41 (0.16) to match the navigation drawer's checked-item highlight (nav_item_fill.xml) for a consistent selected-item visual language across the app. Addresses Greptile P2.
Summary
Fixes a low-contrast bug in the
SimpleMenuPreferencedropdown menus (e.g. Night mode, Service mode, Language). The selected item was filled with an opaquecolorMaterial100— a very light per-theme tint (Dracula#E9DDFB, VerdantMint mint-100, etc.) — while the item'sCheckedTextViewtext stays light. Light text on a light fill made the selected option hard to read, across all themes (worst on dark themes).Fix
Highlight the selected row with a translucent
colorPrimary(~20% alpha) instead of the opaque light fill. This reads clearly on any popup background and keeps the existing text color legible. Matches the pattern already used innav_item_fill.xml(?colorPrimary@ 0.16 alpha) andConfigurationFragment(ColorUtils.setAlphaComponent(primary, 26)).Single-file change in
SimpleMenuPreference.kt; applies to every theme.Testing
assembleOssDebugbuilds clean.Not for merge yet — pending visual review on device.
Greptile Summary
Fixes a low-contrast bug in
SimpleMenuPreferencedropdown menus by swapping the selected-item background from an opaquecolorMaterial100tint to a translucentcolorPrimaryat alpha 41 (~16%), matching thenav_item_fill.xmlpattern used in the navigation drawer.selectedColorvalue is now computed viaColorUtils.setAlphaComponent(colorPrimary, 41)and the correspondingandroidx.core.graphics.ColorUtilsimport is added.GradientDrawableshapes (topDrawable,bottomDrawable,middleDrawable,singleDrawable), covering every positional highlight case.Confidence Score: 5/5
Single-file cosmetic change that swaps one color constant; no logic, state, or API surface is touched.
The change is minimal and self-contained: only the
selectedColorinitializer and one import are modified. The four sharedGradientDrawableinstances are pre-existing and unaffected structurally. No runtime paths, data flow, or external contracts change.No files require special attention.
Important Files Changed
colorMaterial100selected-item fill with a translucentcolorPrimary(alpha 41, ~16%) to fix low-contrast text on dark themes; only the block comment's alpha description is slightly stale.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["getDropDownView(position, ...)"] --> B{position == currentPosition?} B -- No --> C[view.background = null] B -- Yes --> D{position shape?} D -- "count == 1" --> E[singleDrawable\nall corners rounded] D -- "position == 0" --> F[topDrawable\ntop corners rounded] D -- "position == count-1" --> G[bottomDrawable\nbottom corners rounded] D -- else --> H[middleDrawable\nno rounded corners] E & F & G & H --> I["GradientDrawable\nfill = ColorUtils.setAlphaComponent(colorPrimary, 41)\n≈ 16% alpha"]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A["getDropDownView(position, ...)"] --> B{position == currentPosition?} B -- No --> C[view.background = null] B -- Yes --> D{position shape?} D -- "count == 1" --> E[singleDrawable\nall corners rounded] D -- "position == 0" --> F[topDrawable\ntop corners rounded] D -- "position == count-1" --> G[bottomDrawable\nbottom corners rounded] D -- else --> H[middleDrawable\nno rounded corners] E & F & G & H --> I["GradientDrawable\nfill = ColorUtils.setAlphaComponent(colorPrimary, 41)\n≈ 16% alpha"]Reviews (2): Last reviewed commit: "Align dropdown highlight alpha with nav_..." | Re-trigger Greptile